<?php
$ch = curl_init();
   $url = 'http://apis.baidu.com/showapi_open_bus/pic/pic_search?type=4002&page=2';
   $header = array(
       'apikey: 636b61e47e04a42b244f8c0dbfd44edc',
   );
   // 添加apikey到header
   curl_setopt($ch, CURLOPT_HTTPHEADER  , $header);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   // 执行HTTP请求
   curl_setopt($ch , CURLOPT_URL , $url);
   $res = curl_exec($ch);
  $data = json_decode($res)->showapi_res_body->pagebean->contentlist;
  $result = $data[0]->list;
  echo json_encode($result);
?>
